//
//  CYLMainRootViewController.m
//  CYLTabBarController
//
//  Created by chenyilong on 7/3/2019.
//  Copyright © 2019 微博@iOS程序犭袁. All rights reserved.
//

#import "CYLMainRootViewController.h"
#import "HXDCYLMainTabBarController.h"
//#import "DriveCarBarBtn.h"
//#import "LocationHeartManger.h"
#import <MMKV/MMKV.h>

@interface CYLMainRootViewController ()
@property (nonatomic, strong) HXDCYLMainTabBarController *tabBarController;
@end

@implementation CYLMainRootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationBarHidden = YES;
    self.view.backgroundColor = [UIColor whiteColor];
    [self createNewTabBar];
}

- (CYLTabBarController *)createNewTabBar {
//    [DriveCarBarBtn registerPlusButton];
    return [self createNewTabBarWithContext:@""];
}

- (CYLTabBarController *)createNewTabBarWithContext:(NSString *)context {
//    [LocationHeartManger initShareManger].isFirstLoad = NO;
//    BOOL  isCose = [[MMKV defaultMMKV]getBoolForKey:cp_DriveIsCose defaultValue:NO];
//    if (isCose) {
//        context = nil;
////        [DriveCarBarBtn registerPlusButton];
//    }
    HXDCYLMainTabBarController *tabBarController = [[HXDCYLMainTabBarController alloc] initWithContext:context];
    self.viewControllers = @[tabBarController];
    self.tabBarController = tabBarController;
    return tabBarController;
}

- (void)setSelectedIndex:(NSInteger)selectedIndex {
    [self.tabBarController setSelectedIndex:selectedIndex];
}

@end
